﻿using System;
using ZOIL.DataModel;

namespace ZOIL.Library.Components
{
    [ViewModelFor(typeof(TextCardView))]
    public class TextCardViewModel : BaseViewModel
    {

        public TextCardViewModel()
            : base()
        {
            RegisterChangeNotification("ZoomLevel1", "ZoomLevel1");
            RegisterChangeNotification("ZoomLevel2", "ZoomLevel2");
            RegisterChangeNotification("ZoomLevel3", "ZoomLevel3");
            RegisterChangeNotification("SmallText", "SmallText");
            RegisterChangeNotification("LargeText", "LargeText");
            RegisterChangeNotification("ProID", "ProID");
            RegisterChangeNotification("CategoryID", "CategoryID");
            RegisterChangeNotification("CardID", "CardID");
            RegisterChangeNotification("Topic", "Topic");
            RegisterChangeNotification("LogoUrl", "LogoUrl");
            RegisterChangeNotification("TextureUrl", "TextureUrl");
            RegisterChangeNotification("LeftID", "LeftID");
            RegisterChangeNotification("RightID", "RightID");
            RegisterChangeNotification("TopID", "TopID");
            RegisterChangeNotification("BottomID", "BottomID");
            RegisterChangeNotification("FakeZoomLevelIn", "FakeZoomLevelIn");
            RegisterChangeNotification("FakeZoomLevelOut", "FakeZoomLevelOut");

        }

        public new TextCard Model
        {
            get
            {
                return base.Model as TextCard;
            }
            set
            {
                base.Model = value;
            }
        }

        public new object BaseModel
        {
            get
            {
                return base.Model;
            }
            set
            {
                base.Model = value;
            }
        }

        #region Properties

        public int? ProID
        {
            get
            {
                return (Model as TextCard).ProID;
            }
            set
            {
                (Model as TextCard).ProID = value;
                RaisePropertyChangedEvent("ProID");
            }
        }

        public int? CategoryID
        {
            get
            {
                return (Model as TextCard).CategoryID;
            }
            set
            {
                (Model as TextCard).CategoryID = value;
                RaisePropertyChangedEvent("CategoryID");
            }
        }

        public int? CardID
        {
            get
            {
                return (Model as TextCard).CardID;
            }
            set
            {
                (Model as TextCard).CardID = value;
                RaisePropertyChangedEvent("CardID");
            }
        }

        public int? Topic
        {
            get
            {
                return (Model as TextCard).Topic;
            }
            set
            {
                (Model as TextCard).Topic = value;
                RaisePropertyChangedEvent("Topic");
            }
        }

        public Uri LogoUrl
        {
            get
            {
                return new Uri((Model as TextCard).LogoUrl);
            }
            set
            {
                (Model as TextCard).LogoUrl = value.ToString();
                RaisePropertyChangedEvent("LogoUrl");
            }
        }

        public Uri TextureUrl
        {
            get
            {
                return new Uri((Model as TextCard).TextureUrl);
            }
            set
            {
                (Model as TextCard).TextureUrl = value.ToString();
                RaisePropertyChangedEvent("TextureUrl");
            }
        }

        public int? LeftID
        {
            get
            {
                return (Model as TextCard).LeftID;
            }
            set
            {
                (Model as TextCard).LeftID = value;
                RaisePropertyChangedEvent("LeftID");
            }
        }

        public int? RightID
        {
            get
            {
                return (Model as TextCard).RightID;
            }
            set
            {
                (Model as TextCard).RightID = value;
                RaisePropertyChangedEvent("RightID");
            }
        }

        public int? TopID
        {
            get
            {
                return (Model as TextCard).TopID;
            }
            set
            {
                (Model as TextCard).TopID = value;
                RaisePropertyChangedEvent("TopID");
            }
        }

        public int? BottomID
        {
            get
            {
                return (Model as TextCard).BottomID;
            }
            set
            {
                (Model as TextCard).BottomID = value;
                RaisePropertyChangedEvent("BottomID");
            }
        }

        public int? FakeZoomLevelOut
        {
            get
            {
                return (Model as TextCard).FakeZoomLevelOut;
            }
            set
            {
                (Model as TextCard).FakeZoomLevelOut = value;
                RaisePropertyChangedEvent("FakeZoomLevelOut");
            }
        }

        public int? FakeZoomLevelIn
        {
            get
            {
                return (Model as TextCard).FakeZoomLevelIn;
            }
            set
            {
                (Model as TextCard).FakeZoomLevelIn = value;
                RaisePropertyChangedEvent("FakeZoomLevelIn");
            }
        }

        public int? ZoomLevel1
        {
            get
            {
                return (Model as TextCard).ZoomLevel1;
            }
            set
            {
                (Model as TextCard).ZoomLevel1 = value;
                RaisePropertyChangedEvent("ZoomLevel1");
            }
        }

        public int? ZoomLevel2
        {
            get
            {
                return (Model as TextCard).ZoomLevel2;
            }
            set
            {
                (Model as TextCard).ZoomLevel2 = value;
                RaisePropertyChangedEvent("ZoomLevel2");
            }
        }

        public int? ZoomLevel3
        {
            get
            {
                return (Model as TextCard).ZoomLevel3;
            }
            set
            {
                (Model as TextCard).ZoomLevel3 = value;
                RaisePropertyChangedEvent("ZoomLevel3");
            }
        }

        public String SmallText
        {
            get
            {
                return (Model as TextCard).SmallText;
            }
            set
            {
                (Model as TextCard).SmallText = value;
                RaisePropertyChangedEvent("SmallText");
            }
        }

        public String LargeText
        {
            get
            {
                return (Model as TextCard).LargeText;
            }
            set
            {
                (Model as TextCard).LargeText = value;
                RaisePropertyChangedEvent("LargeText");
            }
        }

        #endregion Properties
    }
}
